/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * PostmortemDialog.java
 *
 * Created on Apr 7, 2012, 4:07:11 PM
 */
package Form;

import java.io.File;
import javax.swing.JFileChooser;

/**
 *
 * @author Admin
 */
public class PostmortemDialog extends javax.swing.JPanel {

    /** Creates new form PostmortemDialog */
    public PostmortemDialog() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jTextField7 = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        jLabel7 = new javax.swing.JLabel();
        jButton2 = new javax.swing.JButton();
        jLabel8 = new javax.swing.JLabel();
        jTextField8 = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        jTextField9 = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jButton3 = new javax.swing.JButton();
        jLabel10 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jTextField2 = new javax.swing.JTextField();
        jTextField3 = new javax.swing.JTextField();
        jTextField4 = new javax.swing.JTextField();
        jTextField5 = new javax.swing.JTextField();
        jScrollPane2 = new javax.swing.JScrollPane();
        jTextArea2 = new javax.swing.JTextArea();
        jTextField6 = new javax.swing.JTextField();
        jTextField1 = new javax.swing.JTextField();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTextArea1 = new javax.swing.JTextArea();
        jPanel3 = new javax.swing.JPanel();
        jTextField10 = new javax.swing.JTextField();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jTextField11 = new javax.swing.JTextField();
        jButton4 = new javax.swing.JButton();
        jScrollPane3 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();

        setPreferredSize(new java.awt.Dimension(690, 565));
        setLayout(null);

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 204, 255)), "Postmortem", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), new java.awt.Color(255, 0, 0))); // NOI18N
        jPanel1.setLayout(null);

        jTextField7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextField7ActionPerformed(evt);
            }
        });
        jPanel1.add(jTextField7);
        jTextField7.setBounds(420, 20, 230, 20);

        jLabel2.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel2.setText("Age");
        jPanel1.add(jLabel2);
        jLabel2.setBounds(20, 60, 22, 15);

        jLabel1.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel1.setText("Name");
        jLabel1.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);
        jLabel1.setAlignmentX(0.5F);
        jPanel1.add(jLabel1);
        jLabel1.setBounds(20, 20, 31, 15);

        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Form/Image/choose-icon.png"))); // NOI18N
        jButton1.setText("Choose");
        jButton1.setMargin(new java.awt.Insets(2, 2, 2, 14));
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });
        jPanel1.add(jButton1);
        jButton1.setBounds(230, 250, 81, 29);

        jLabel7.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel7.setText("Date of Death");
        jPanel1.add(jLabel7);
        jLabel7.setBounds(320, 100, 100, 15);

        jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Form/Image/add-icon.png"))); // NOI18N
        jButton2.setText("Add");
        jButton2.setMargin(new java.awt.Insets(2, 2, 2, 14));
        jButton2.setVerifyInputWhenFocusTarget(false);
        jPanel1.add(jButton2);
        jButton2.setBounds(120, 310, 63, 29);

        jLabel8.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel8.setText("Case Description");
        jPanel1.add(jLabel8);
        jLabel8.setBounds(320, 220, 89, 15);
        jPanel1.add(jTextField8);
        jTextField8.setBounds(420, 100, 130, 20);

        jLabel5.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel5.setText("Image");
        jPanel1.add(jLabel5);
        jLabel5.setBounds(20, 255, 34, 15);

        jTextField9.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextField9ActionPerformed(evt);
            }
        });
        jPanel1.add(jTextField9);
        jTextField9.setBounds(420, 60, 130, 20);

        jLabel6.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel6.setText("Date Of Found");
        jPanel1.add(jLabel6);
        jLabel6.setBounds(320, 60, 90, 20);

        jLabel3.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel3.setText("Personal ID");
        jPanel1.add(jLabel3);
        jLabel3.setBounds(20, 100, 61, 15);

        jLabel4.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel4.setText("Address");
        jPanel1.add(jLabel4);
        jLabel4.setBounds(20, 140, 43, 15);

        jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Form/Image/stop-icon.png"))); // NOI18N
        jButton3.setText("Exit");
        jButton3.setMargin(new java.awt.Insets(2, 2, 2, 14));
        jPanel1.add(jButton3);
        jButton3.setBounds(230, 310, 63, 29);

        jLabel10.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel10.setText("Doctor Name");
        jPanel1.add(jLabel10);
        jLabel10.setBounds(320, 20, 72, 15);

        jLabel9.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel9.setText("Murder Weapon");
        jPanel1.add(jLabel9);
        jLabel9.setBounds(320, 140, 88, 15);

        jLabel11.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel11.setText("Relative Name");
        jPanel1.add(jLabel11);
        jLabel11.setBounds(320, 180, 77, 15);
        jPanel1.add(jTextField2);
        jTextField2.setBounds(90, 20, 220, 20);
        jPanel1.add(jTextField3);
        jTextField3.setBounds(90, 100, 220, 20);
        jPanel1.add(jTextField4);
        jTextField4.setBounds(90, 60, 50, 20);

        jTextField5.setMinimumSize(new java.awt.Dimension(6, 22));
        jTextField5.setPreferredSize(new java.awt.Dimension(59, 22));
        jTextField5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextField5ActionPerformed(evt);
            }
        });
        jPanel1.add(jTextField5);
        jTextField5.setBounds(90, 250, 130, 20);

        jTextArea2.setColumns(20);
        jTextArea2.setLineWrap(true);
        jTextArea2.setRows(5);
        jScrollPane2.setViewportView(jTextArea2);

        jPanel1.add(jScrollPane2);
        jScrollPane2.setBounds(90, 140, 220, 100);
        jPanel1.add(jTextField6);
        jTextField6.setBounds(420, 140, 230, 20);
        jPanel1.add(jTextField1);
        jTextField1.setBounds(420, 180, 230, 20);

        jTextArea1.setColumns(20);
        jTextArea1.setLineWrap(true);
        jTextArea1.setRows(5);
        jScrollPane1.setViewportView(jTextArea1);

        jPanel1.add(jScrollPane1);
        jScrollPane1.setBounds(420, 220, 230, 96);

        add(jPanel1);
        jPanel1.setBounds(10, 10, 670, 350);

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 204, 255)), "Search", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), new java.awt.Color(255, 0, 0))); // NOI18N
        jPanel3.setLayout(null);
        jPanel3.add(jTextField10);
        jTextField10.setBounds(80, 20, 160, 20);

        jLabel12.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel12.setText("Name");
        jPanel3.add(jLabel12);
        jLabel12.setBounds(20, 20, 40, 15);

        jLabel13.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel13.setText("Personal ID");
        jPanel3.add(jLabel13);
        jLabel13.setBounds(270, 23, 61, 15);
        jPanel3.add(jTextField11);
        jTextField11.setBounds(350, 20, 150, 20);

        jButton4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Form/Image/search-icon.png"))); // NOI18N
        jButton4.setText("Search");
        jButton4.setMargin(new java.awt.Insets(2, 2, 2, 14));
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });
        jPanel3.add(jButton4);
        jButton4.setBounds(520, 20, 80, 29);

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane3.setViewportView(jTable1);

        jPanel3.add(jScrollPane3);
        jScrollPane3.setBounds(20, 60, 630, 130);

        add(jPanel3);
        jPanel3.setBounds(10, 360, 670, 200);
    }// </editor-fold>//GEN-END:initComponents

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed

                                JFileChooser chooser = new JFileChooser();
				chooser.setMultiSelectionEnabled(true);
				int option = chooser.showOpenDialog(PostmortemDialog.this);
				if (option == JFileChooser.APPROVE_OPTION) {
					File[] sf = chooser.getSelectedFiles();
					String filelist = "nothing";
					if (sf.length > 0){
						filelist = sf[0].getName();
                                        }
					for (int i = 1; i < sf.length; i++){
						filelist += ", " + sf[i].getName();
                                        }
					jTextField5.setText(filelist);
				} else
				jTextField5.setText(null);
                                
			
		
}//GEN-LAST:event_jButton1ActionPerformed

private void jTextField9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField9ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jTextField9ActionPerformed

private void jTextField5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField5ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jTextField5ActionPerformed

private void jTextField7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField7ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jTextField7ActionPerformed

private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jButton4ActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JTable jTable1;
    private javax.swing.JTextArea jTextArea1;
    private javax.swing.JTextArea jTextArea2;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField10;
    private javax.swing.JTextField jTextField11;
    private javax.swing.JTextField jTextField2;
    private javax.swing.JTextField jTextField3;
    private javax.swing.JTextField jTextField4;
    private javax.swing.JTextField jTextField5;
    private javax.swing.JTextField jTextField6;
    private javax.swing.JTextField jTextField7;
    private javax.swing.JTextField jTextField8;
    private javax.swing.JTextField jTextField9;
    // End of variables declaration//GEN-END:variables
}
